//
//  RightViewController.m
//  Leisure
//
//  Created by Alex on 16/6/28.
//  Copyright © 2016年 蓝鸥科技有限公司西安分公司. All rights reserved.
//

#import "RightViewController.h"

@interface RightViewController ()

@end

@implementation RightViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 创建barButton
    self.navigationItem.leftBarButtonItem = ({
        UIBarButtonItem *item = [[UIBarButtonItem alloc]initWithTitle:@"菜单" style:UIBarButtonItemStylePlain target:self action:@selector(itemAction)];
        item;
    });
    
//    self.navigationController.navigationBar.translucent = NO;
 
}

// 事件
- (void)itemAction {
    
    if (!self.isSlider) {
        
    // 向右偏移
    [UIView animateWithDuration:0.2 animations:^{
     
        self.navigationController.view.frame = CGRectMake(kWidth/2, 0, kWidth, kHeight+64);
    }];
    
    } else {
        
        // 回到原位
        [UIView animateWithDuration:0.2 animations:^{
            
           self.navigationController.view.frame = CGRectMake(0, 0, kWidth, kHeight+64);
        }];
    }
    // 对上一次进行取反
    self.isSlider = !self.isSlider;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
   
}



@end
